#include "processBar.h"



void processbar(int speed)
{
    const char* lable = "|/-\\";
    char bar[NUM];
    memset(bar, '\0', sizeof(bar));
    int cnt = 0;
    int len = strlen(lable);
    while(cnt <= 100)
    {
        printf("[%-100s][%d%%][%c]\r", bar, cnt, lable[cnt % len]);
        fflush(stdout);
        bar[cnt++] = SYMBOL;
        if(cnt < 100)
        {
            bar[cnt] = '>';
        }
        usleep(speed);
    }
    printf("\n");
}
